#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2020 crane <crane@crane-pc>
#
# Distributed under terms of the MIT license.

"""

"""


class Solution(object):
    @staticmethod
    def restoreString(s, indices):
        result = len(s) * ['']

        for c, i in zip(s, indices):
            result[i] = c

        return ''.join(result)


def test():
    s = Solution()
    ss = "codeleet"

    indices = [4, 5, 6, 7, 0, 2, 1, 3]

    ret = s.restoreString(ss, indices)
    print(ret)


def main():
    print("start main")
    test()


if __name__ == "__main__":
    main()
